// radiusPostion : 指定圆角的位置
// opacity:指定元素的透明度
// color:指定元素的颜色

import classNames from "classnames";
import "./card.scss";
type CardProps = {
  radiusPostion?:
    | ""
    | "top-right"
    | "top-left"
    | "bottom-right"
    | "bottom-left"
    | "top"
    | "bottom"
    | "left"
    | "right";
  color?: string;
  children: React.ReactElement | string | React.ReactElement[];
  className?: string;
  isTBody?: boolean;
};
export const Card = ({
  radiusPostion = "",
  children,
  className = "",
  isTBody,
  ...rest
}: CardProps): React.ReactElement => {
  const cardClassName = () => {
    return classNames(
      "dashboard_card",
      radiusPostion,
      isTBody && "is_tbody",
      className
    );
  };

  return (
    <>
      <div className={cardClassName()} {...rest}>
        {children}
      </div>
    </>
  );
};
